home *** CD-ROM | disk | FTP | other *** search
/ F1 Licenseware / F1 Licenseware - Volume 1.iso / disks / 050a.dms / 050a.adf / EXAMPLE_PROGRAMS / example15.AMOS / example15.amosSourceCode
AMOS Source Code  |  1992-02-26  |  2KB  |  76 lines

  1. '================= 
  2. Rem example15.amos 
  3. '================= 
  4.  
  5. Rem An example of selecting options with a mouse 
  6. '----------------------------------------------- 
  7.  
  8.  
  9.  
  10. Rem Open a hires screen
  11. '----------------------- 
  12. Screen Open 0,640,200,8,Hires
  13.  
  14.  
  15. Rem set up mouse and screen colours
  16. '----------------------------------- 
  17. Change Mouse 2 : Paper 6 : Curs Off : Cls 6
  18.  
  19.  
  20. Rem set underlined text to on and print a centered message.  
  21. '----------------------------------------------------------  
  22. Under On 
  23. Centre "Move the mouse pointer over a box and click the left button"
  24.  
  25.  
  26. Rem now turn underlined text off, so as not to affect any further text.
  27. '----------------------------------------------------------------------
  28. Under Off 
  29.  
  30.  
  31. Rem reserve some zones for four boxes. 
  32. '------------------------------------- 
  33. Reserve Zone 4
  34.  
  35.  
  36. Rem Set the print position for where we want the box placed
  37. Rem then print the box using border$ the last number is box type.
  38. '----------------------------------------------------------------
  39. Locate 20,10 : Print Border$(Zone$("BOX 1",1),1)
  40. Locate 30,10 : Print Border$(Zone$("BOX 2",2),2)
  41. Locate 40,10 : Print Border$(Zone$("BOX 3",3),3)
  42. Locate 50,10 : Print Border$(Zone$("EXIT",4),4)
  43.  
  44. Rem this is the start of the main loop, look up DO LOOP in your notes. 
  45. '--------------------------------------------------------------------- 
  46. Do 
  47.  
  48.  
  49. Rem wait for a mouse button to be pressed. 
  50. '----------------------------------------
  51. While Mouse Key=0 : Wend 
  52.  
  53.  
  54. Rem set the variable kk to hold the number of the zone the mouse pointer 
  55. Rem was over when the button was clicked.  
  56. '------------------------------------------------------------------------
  57. KK=Mouse Zone
  58.  
  59.  
  60. Rem set text cursor  
  61. '------------------
  62. Locate 0,20
  63.  
  64.  
  65. Rem if mouse zone is over box 1 (kk=1) then print centered on screen "box 1".
  66. Rem and so on. 
  67. '----------------------------------------------------------------------------
  68. If KK=1 Then Centre "You selected BOX 1"
  69. If KK=2 Then Centre "You selected BOX 2"
  70. If KK=3 Then Centre "You selected BOX 3"
  71. If KK=4 Then Centre "You selected EXIT!" : Wait 50 : Edit 
  72.  
  73.  
  74. Rem jump back to the start of the DO LOOP and start checking the mouse again   
  75. '--------------------------------------------------------------------------- 
  76. Loop